<template xmlns:font-faminy="http://www.w3.org/1999/xhtml">
  <div class="QrShow" runat="server">
    <el-container>
      <el-main>
          <div class="demo-image__placeholder" align="center">
            <div class="block">
              <span class="demonstration"><i>二维码图片</i></span>
              <el-divider></el-divider>
              <el-image :src="src" style="width: 50%"></el-image>
            </div>
            <el-divider></el-divider>
            <el-button type="primary" round align="center" @click="showQr">生成二维码</el-button>
          </div>

      </el-main>
    </el-container>
  </div>
</template>

<script>
import {setToken} from "@/utils/Token";
import {QrInfo, QrCreate} from "@/api/admin_api";

export default {
  name: "QrShow",
    data() {
      return {
        src: '',
        communityId:'',
      }
    },
  created() {
    // setToken('token', 'eyJjdHkiOiJIUzI1NiIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJuZXRJZCI6OCwiaWRlbnRpdHkiOjIsIm5ldFBhc3N3b3JkIjoiJDJhJDEwJDlMRXdsZ3VXc3RWV2MyMmhtcVNUcU9mNUpqdnJiRHc5ZU9oRVd2bHovYU5vd2J5V1RKMk1DIiwiY29tbXVuaXR5SWQiOjEsImV4cCI6MTY2NDQ0NjU5NiwiYWNjb3VudCI6IjUwMzA2MTM2NUBxcS5jb20ifQ.u_XPFF6CZLGt8Z0_9MzMgTRAtem99Y52cV8fmVVE5LQ')
    QrCreate().then(() => {
    });
    QrInfo().then((reg) => {
      this.src = reg.data.data.qrName;
    });
  },
  methods:{
    showQr(){
     // setToken('token', 'eyJjdHkiOiJIUzI1NiIsInR5cCI6IkpXVCIsImFsZyI6IkhTMjU2In0.eyJuZXRJZCI6OCwiaWRlbnRpdHkiOjIsIm5ldFBhc3N3b3JkIjoiJDJhJDEwJDlMRXdsZ3VXc3RWV2MyMmhtcVNUcU9mNUpqdnJiRHc5ZU9oRVd2bHovYU5vd2J5V1RKMk1DIiwiY29tbXVuaXR5SWQiOjEsImV4cCI6MTY2NDQ0NjU5NiwiYWNjb3VudCI6IjUwMzA2MTM2NUBxcS5jb20ifQ.u_XPFF6CZLGt8Z0_9MzMgTRAtem99Y52cV8fmVVE5LQ')
      QrCreate().then(() => {
      });
      QrInfo().then((reg) => {
        this.src = reg.data.data.qrName;
      });
    }
  }
}
</script>

<style scoped>

</style>